package com.relational.mapping.Service.Impl;

import com.relational.mapping.Model.Menu;
import com.relational.mapping.Repository.MenuRepository;
import com.relational.mapping.Service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Csea
 * @title
 * @date 2019/6/10 16:14
 */
@Service
public class MenuServiceImpl implements MenuService {
    @Autowired
    private MenuRepository repository;

    @Override
    public Menu save(Menu menu) {
        return repository.save(menu);
    }

    @Override
    public Menu findById(Integer menuId) {
        return repository.findById(menuId).orElse(null);
    }

    @Override
    public void deleteById(Integer menuId) {
        repository.deleteById(menuId);
    }
}
